<template>
    <div>
        <div class="content">
            <el-form inline>
                <!--            <el-form-item label="参考系类型">-->
                <!--                <el-select v-model="referenceType" size="mini">-->
                <!--                    <el-option label="WGS84" :value="0"></el-option>-->
                <!--                </el-select>-->
                <!--            </el-form-item>-->
                <el-form-item label="开始时间">
                    <el-date-picker type="datetime" placeholder="选择开始时间" size="mini"></el-date-picker>
                </el-form-item>
                <el-form-item label="结束时间">
                    <el-date-picker type="datetime" placeholder="选择结束时间" size="mini"></el-date-picker>
                </el-form-item>
                <el-form-item>
                    <el-button type="info" size="mini">查询</el-button>
                </el-form-item>
            </el-form>
            <div id="SinglePointAnalysis" style="height:79vh;"></div>
        </div>
    </div>
</template>

<script>
    import echarts from "echarts";

    export default {
        name: "SinglePointAnalysis",
        props: {
            source: {
                type: Object,
                default() {
                    return {};
                }
            },
            node: Object
        },
        data() {
            return {
                referenceType: 'WGS84'
            }
        },
        mounted() {
            var myChart = echarts.init(document.getElementById('SinglePointAnalysis'));

            myChart.setOption({
                title: {
                    text: "短临预测变化图#" + this.node.label,
                    left: '600px'
                },
                grid: {
                    left: '5%',
                    bottom: '3%',
                    right: '3%'
                },
                xAxis: {
                    type: 'category',
                    data: this.source.data.x
                },
                yAxis: {
                    name: "单位(mm)",
                    type: 'value',
                    min(v) {
                        const m = Math.round(v.min - (v.max - v.min) / 3);
                        return m < v.min ? m : Math.floor(v.min / 2);
                    }
                },
                series: [{
                    data: this.source.data.y,
                    type: 'line',
                    itemStyle: {
                        color: this.source.color
                    }
                }]
            })
        },
        methods: {}
    }
</script>

<style scoped>
    .content {
        height: 87vh;
    }
</style>
